package bingfa;

import bingfa.entity.MyTask;
import bingfa.entity.MyThread;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Timer;

/**
 * Created by Administrator on 2015/12/28.
 */
public class test_03 {
    public static void main(String[] args){



        try {
            Date date = new Date();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH mm ss");
            String str = sdf.format(date);

            String sssss = "2016 04 01 15 12 02";
            Date appoint = sdf.parse(sssss);

            Calendar c1 = Calendar.getInstance();
            c1.setTime(appoint);
            c1.set(Calendar.HOUR_OF_DAY, 0);
            c1.set(Calendar.MINUTE, 0);
            c1.set(Calendar.SECOND, 0);
            Date date1 = c1.getTime();
            System.out.println(sdf.format(date1));



//            Calendar c2 = Calendar.getInstance();
//            c2.setTime(appoint);
            c1.set(Calendar.HOUR_OF_DAY, 23);
            c1.set(Calendar.MINUTE, 59);
            c1.set(Calendar.SECOND, 59);

            Date date2 = c1.getTime();
            System.out.println(sdf.format(date2));

        } catch (ParseException e) {
            e.printStackTrace();
        }

//        Timer timer = new Timer();
//        timer.schedule(new MyTask("sdgfadsfasdf"), 1000, 2*1000);

//        MyThread myThread = new MyThread("sdfafdasdfas");
//        myThread.start();
//
//        System.out.println("231908754orfa;lsut-8903q242785t1o3q");
//


    }
}
